Skip to content

fix: tolerate install-mutated validate artifacts - #664

Merged
rafaelscosta merged 2 commits into
mainfrom
fix/validate-mutable-install-artifacts-20260507
May 7, 2026
Merged

fix: tolerate install-mutated validate artifacts#664
rafaelscosta merged 2 commits into
mainfrom
fix/validate-mutable-install-artifacts-20260507

Conversation

@rafaelscosta

@rafaelscosta rafaelscosta commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #663.

This PR makes aiox validate tolerate the two .aiox-core files that are intentionally mutated during a clean install:

  • core-config.yaml, generated or merged by environment configuration
  • data/entity-registry.yaml, populated by entity registry bootstrap

The validator still checks existence, path containment, symlink rejection, and regular-file safety before treating these files as valid project-local install artifacts. Hash and size checks remain strict for non-mutable framework files. I also tightened report semantics so any real missing/corrupted file produces at least warning status.

Validation

  • npm test -- tests/installer/post-install-validator.test.js --runInBand
  • node -c packages/installer/src/installer/post-install-validator.js
  • npm run generate:manifest
  • npm run validate:manifest
  • Local package smoke with packed @aiox-squads/core@5.1.4:
    • npx --yes aiox --version -> 5.1.4
    • npx --yes aiox validate --json -> status: success, validFiles: 1103, corruptedFiles: 0, issueCount: 0
  • npm run lint -- --quiet
  • npm run typecheck
  • npm run validate:publish
  • git diff --check
  • npm run test:ci -> 313 suites passed, 7,824 tests passed, 149 skipped

Notes

The previous published smoke for 5.1.3 reproduced the issue with corruptedFiles: 2; this branch verifies the same install/validate sequence locally as 5.1.4 with corruptedFiles: 0.

Summary by CodeRabbit

  • Bug Fixes

    • Validation no longer flags installer-created or installer-mutated files as corrupted, preventing false corruption warnings after install.
  • Tests

    • Added regression tests covering mutable-artifact validation and manifest mutation scenarios.
  • Documentation

    • Added a story describing validation behavior, acceptance criteria, and verification steps for mutable installation artifacts.

@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aiox-core Ready Ready Preview, Comment May 7, 2026 11:35am

Request Review

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 68addcca-d7fd-44e1-83fc-cdc1f436d80f

📥 Commits

Reviewing files that changed from the base of the PR and between 9b4b0cb and a1efc25.

📒 Files selected for processing (1)
  • docs/stories/epic-123/STORY-123.6-validate-mutable-install-artifacts.md

Walkthrough

This PR treats specific install-manifest paths as project-mutable so post-install validation marks them valid without hash/size checks, preserves other validation rules, exposes a helper to classify those paths, adds tests, and bumps package/manifest versions.

Changes

Mutable Install Artifacts Support

Layer / File(s) Summary
Specification & Goals
docs/stories/epic-123/STORY-123.6-validate-mutable-install-artifacts.md
Story doc defines acceptance criteria and lists mutable install artifact paths while preserving containment/symlink/type checks.
Mutable Path Detection Logic
packages/installer/src/installer/post-install-validator.js
Adds PROJECT_MUTABLE_MANIFEST_PATHS and updates validateFile() to mark matching entries as projectMutable and skip hash/size comparisons.
Public API Export
packages/installer/src/installer/post-install-validator.js
Exports isProjectMutableManifestPath() for external classification of mutable manifest paths.
Test Coverage
tests/installer/post-install-validator.test.js
Adds tests verifying mutable path classification and validator behavior: mutable paths do not trigger corruption, non-mutable paths still report corruption.
Version & Release Updates
.aiox-core/install-manifest.yaml, package.json
Bumps version from 5.1.3 to 5.1.4 and refreshes manifest generated_at metadata.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Installer
  participant PostInstallValidator
  participant InstallManifest
  Client->>Installer: run aiox install
  Installer->>InstallManifest: write install files (including mutable paths)
  Client->>PostInstallValidator: run aiox validate
  PostInstallValidator->>InstallManifest: read manifest entries
  PostInstallValidator->>InstallManifest: isProjectMutableManifestPath? (classification)
  alt project-mutable
    PostInstallValidator->>PostInstallValidator: mark projectMutable, skip hash/size checks
  else immutable
    PostInstallValidator->>PostInstallValidator: perform hash/size comparison
  end
  PostInstallValidator->>Client: return validation report
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

area: installer, type: test, area: docs

Suggested reviewers

  • Pedrovaleriolopez
  • oalanicolas
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing validation to tolerate files mutated during install.
Linked Issues check ✅ Passed All coding requirements from issue #663 are met: validator now classifies mutable paths, skips strict hash/size checks for them, and maintains other validation checks.
Out of Scope Changes check ✅ Passed All changes directly support the stated objective of tolerating mutable install artifacts; version bumps and documentation updates are appropriate scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/validate-mutable-install-artifacts-20260507

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added area: agents Agent system related area: workflows Workflow system related squad mcp type: test Test coverage and quality area: core Core framework (.aios-core/core/) area: installer Installer and setup (packages/installer/) area: synapse SYNAPSE context engine area: cli CLI tools (bin/, packages/aios-pro-cli/) area: pro Pro features (pro/) area: health-check Health check system area: docs Documentation (docs/) area: devops CI/CD, GitHub Actions (.github/) labels May 7, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Coverage report not available

📈 Full coverage report available in Codecov


Generated by PR Automation (Story 6.1)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/stories/epic-123/STORY-123.6-validate-mutable-install-artifacts.md`:
- Around line 46-50: Replace the machine-local absolute file links in
STORY-123.6-validate-mutable-install-artifacts.md with repository-relative
links: locate the list items referencing ".aiox-core/install-manifest.yaml",
"package.json", "package-lock.json",
"packages/installer/src/installer/post-install-validator.js", and
"tests/installer/post-install-validator.test.js" and change their hrefs from the
full local path (/Users/rafaelcosta/Projects/AIOX/aiox-core-pro-13-2/...) to
repo-relative paths appropriate for the docs file (e.g., relative paths from the
docs/stories folder like ../../.aiox-core/install-manifest.yaml or the correct
relative path to each file in the repo) so other contributors can access them
without exposing local machine paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 363633c6-021c-4f95-a504-d2305956d07d

📥 Commits

Reviewing files that changed from the base of the PR and between 80485c6 and 9b4b0cb.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .aiox-core/install-manifest.yaml
  • docs/stories/epic-123/STORY-123.6-validate-mutable-install-artifacts.md
  • package.json
  • packages/installer/src/installer/post-install-validator.js
  • tests/installer/post-install-validator.test.js

Comment thread docs/stories/epic-123/STORY-123.6-validate-mutable-install-artifacts.md Outdated
@rafaelscosta
rafaelscosta merged commit 2dac962 into main May 7, 2026
40 checks passed
@rafaelscosta
rafaelscosta deleted the fix/validate-mutable-install-artifacts-20260507 branch May 7, 2026 11:39
tuanmedeiros pushed a commit to tuanmedeiros/aios-core-synkraay that referenced this pull request Jun 2, 2026
* fix: tolerate install-mutated validate artifacts (SynkraAI#663)

* docs: use repo-relative story file links (SynkraAI#663)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Agent system related area: cli CLI tools (bin/, packages/aios-pro-cli/) area: core Core framework (.aios-core/core/) area: devops CI/CD, GitHub Actions (.github/) area: docs Documentation (docs/) area: health-check Health check system area: installer Installer and setup (packages/installer/) area: pro Pro features (pro/) area: synapse SYNAPSE context engine area: workflows Workflow system related mcp squad type: test Test coverage and quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(validate): install limpo marca artefatos mutáveis como corrupted

1 participant